/**
 * <p>service</p>
 * <PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 * </PRE>
 *
 * @author zl
 * @date Created in 2019/4/15 15:50
 * @version 1.0
 * @copyright: Copyright (c) founders
 *
 *
 * jpa example：
 *
 * @Service
 * @Slf4j
 * public class TestService {
 *
 *      @Autowired
 *      TestRepository testRepository;
 *
 *      public Page<Test>  list(String name,Integer type,Long[] ids,Integer page,Integer pageSize){
 *
 *          Specification<Test> querySpecifi = new Specification<Test>() {
 *
 *              @Override
 *              public Predicate toPredicate(Root<Test> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) {
 *                  List<Predicate> predicates = new ArrayList<>();
 *                  predicates.add(cb.equal(root.get("type").as(Integer.class), type));
 *                  predicates.add(cb.like(root.get("name").as(String.class), "%"+name+"%"));
 *                  CriteriaBuilder.In<Long> idsIn = cb.in(root.get("id"));
 *                  for (int i = 0; i < ids.length; i++) {
 *                      idsIn.value(ids[i]);
 *                  }
 *                  predicates.add(idsIn);
 *                  return cb.and(predicates.toArray(new Predicate[predicates.size()]));
 *              }
 *           };
 *
 *           List<String> orderKeys = new ArrayList<>();
 *           orderKeys.add("createTime");
 *           Sort sort = new Sort(Sort.Direction.DESC,orderKeys);
 *
 *           Pageable pageable = new PageRequest(page,pageSize,sort).previous();
 *           Page<Test> list = testRepository.findAll(querySpecifi,pageable);
 *           return list;
 *
 *       }
 *
 * }
 *
 */

package com.zlcx.tz.live.service.impl;